

// fusionChart 配置模板
var doughnut2DSource = {
    "chart": {
        "caption": "",
        "subCaption": "",
        "numberPrefix": "",
        // "paletteColors": "#F58C1F,#FAA719,#fbbd54,#E8C778,#F2E0B0",//"#00ff00,#ff00ff,#0000ff,#ff0000,#ffff00",//绿，紫，蓝，红，黄//
        "paletteColors": "#F68C1F,#1270b8,#a6ddf6,#35ace1,#4285f4,#ffd200",
        "showBorder": "0",
        "use3DLighting": "0",
        "showShadow": "0",
        "enableSmartLabels": "0",
        "startingAngle": "310",
        "showLabels": "0",
        "showPercentValues": "0",
        "showLegend": "0",
        "legendPosition": "BUTTOM",
        "showValues": "0",
        "legendShadow": "0",
        "legendBorderAlpha": "0",
        "decimals": "0",
        "showToolTip": "1",
        "toolTipColor": "#ffffff",
        "toolTipBorderThickness": "0",
        "toolTipBgColor": "#000000",
        "toolTipBgAlpha": "50",
        "toolTipBorderRadius": "2",
        "toolTipPadding": "5",
        "pieRadius": "35",
        "canvasBgAlpha": "0",
        "showCanvasBg": "0",
        "bgcolor": "#ffffff",
        "plottooltext": "$label:$value",
        "formatNumberScale": 0,
        interactiveLegend:0,
        "bgAlpha": "0",
        "theme": "fint",
        "enableSlicing": '1',
        // "centerLabel": "$label: $value",
        // "centerLabelBold": "0",
    },
    "data": [
        // {"label": "Food", "value": "28504"},
    ]
};

const doughNut2DConfig = {
    type: 'doughnut2D',
    renderAt: 'chartJy',
    width: '100%',
    height: '120',
    dataSource: doughnut2DSource
};

const lineConfig = {
    type: 'msline',
    renderAt: 'chartYJL',
    width: '100%',
    height: '240',
    dataFormat: 'json',
    dataSource: {
        "chart": {
            "caption": "",
            "captionfontsize": "9",
            "baseFontColor": "#777777",
            "legendItemFontColor": "#888888",
            "toolTipBgColor": "#ffffff",
            "toolTipBorderColor": "#ffffff",
            "subCaption": "",
            "xAxisName": "",
            "yAxisName": "",
            "numberPrefix": "",
            "theme": "fint",
            "showValues": "0",
            "paletteColors": "#F68C1F,#1270b8,#a6ddf6,#35ace1,#4285f4,#ffd200",
            "divLineAlpha": "15",
            "divLineDashed": "0",
            "lineThickness": "1",
            "labelStep": "1",
            "legendBorderAlpha": "0",
            "legendShadow": "0",
            "legendPadding": "0",
            "canvasPadding": "0",
            "chartTopMargin": "10",
            "chartBottomMargin": "10",
            "showAlternateHGridColor": "0",
            "showBorder": "0",
            "canvasBorderalpha": "0",
            "canvasBgAlpha": "0",
            "showCanvasBg": "0",
            chartRightMargin: "30",
            "plottooltext": "$datavalue",
            showXAxisLine:'1',
            "axisLineAlpha": "15",
            formatNumberScale: 0,
            drawAnchors: "1",
            anchorRadius: 2,
            labelDisplay:'Rotate',
            slantLabels:'1',
            "bgcolor": "#ffffff",
            "bgAlpha": "0",
        },
        "categories": [{
            "category": [] //[{"label": '2012-01-01'}]
        }],
        "dataset": []
        // "dataset": [{
        //     "seriesname": '',//name,
        //     "data": []//[{"value": "10000"},]
        // }, {
        //     "seriesname": '', //"CSI 300",
        //     "data": []//[{"value": "10000"},]
        // }]
    }
};

const column2DConfig = {
    type: 'mscolumn2d',
    renderAt: 'chart',
    width: '100%',
    height: '240',
    dataFormat: 'json',
    dataSource:{
        "chart": {
            "caption": "",
            "numberprefix": "",
            "plotgradientcolor": "",
            "bgcolor": "FFFFFF",
            "showalternatehgridcolor": "0",
            "legendshadow": "0",
            "legendborderalpha": "0",
            "showplotborder": "0",
            "showborder": "0",
            "captionfontsize": "9",
            "baseFontColor": "777777",
            "legendItemFontColor": "888888",
            "toolTipBgColor": "ffffff",
            "toolTipBorderColor": "ffffff",
            "canvasBorderThickness": "0",
            "subCaption": "",
            "xAxisName": "",
            "yAxisName": "",
            "theme": "fint",
            "showValues": "0",
            "paletteColors": "#F68C1F,#1270b8,#a6ddf6,#35ace1,#4285f4,#ffd200",
            "divLineAlpha": "15",
            "divLineDashed": "0",
            "lineThickness": "1",
            "legendPosition": "BOTTOM",
            labelDisplay:'Rotate',
            slantLabels:'1',
            "plottooltext": "$datavalue",
            formatNumberScale: 0,
            "anchorRadius": "0"
        },
        "categories": [
            {
                "category": [
                    {
                        "label": "Jan"
                    },
                    {
                        "label": "Feb"
                    },
                    {
                        "label": "Mar"
                    },
                    {
                        "label": "Apr"
                    },
                    {
                        "label": "May"
                    },
                    {
                        "label": "Jun"
                    },
                    {
                        "label": "Jul"
                    },
                    {
                        "label": "Aug"
                    },
                    {
                        "label": "Sep"
                    },
                    {
                        "label": "Oct"
                    },
                    {
                        "label": "Nov"
                    },
                    {
                        "label": "Dec"
                    }
                ]
            }
        ],
        "dataset": [
            {
                "seriesname": "2013",
                parentyaxis: 'S',
                "data": [
                    {
                        "value": "22400"
                    },
                    {
                        "value": "24800"
                    },
                    {
                        "value": "21800"
                    },
                    {
                        "value": "21800"
                    },
                    {
                        "value": "24600"
                    },
                    {
                        "value": "27600"
                    },
                    {
                        "value": "26800"
                    },
                    {
                        "value": "27700"
                    },
                    {
                        "value": "23700"
                    },
                    {
                        "value": "25900"
                    },
                    {
                        "value": "26800"
                    },
                    {
                        "value": "24800"
                    }
                ]
            },
            {
                "seriesname": "2012",
                "data": [
                    {
                        "value": "10000"
                    },
                    {
                        "value": "11500"
                    },
                    {
                        "value": "12500"
                    },
                    {
                        "value": "15000"
                    },
                    {
                        "value": "16000"
                    },
                    {
                        "value": "17600"
                    },
                    {
                        "value": "18800"
                    },
                    {
                        "value": "19700"
                    },
                    {
                        "value": "21700"
                    },
                    {
                        "value": "21900"
                    },
                    {
                        "value": "22900"
                    },
                    {
                        "value": "20800"
                    }
                ]
            }
        ]
    }
}

const pie2DConfig = {
    type: 'pie2d',
    renderAt: 'chart_3',
    width: '100%',
    height: '130',
    dataFormat: 'json',
    dataSource:{
        "chart": {
            "caption": "",
            "subCaption": "",
            "numberPrefix": "",
            "paletteColors": "#F68C1F,#1270b8,#a6ddf6,#35ace1,#4285f4,#ffd200",
            "bgalpha": "0",
            "showBorder": "0",
            "use3DLighting": "0",
            "showShadow": "0",
            "enableSmartLabels": "0",
            "startingAngle": "310",
            "showLabels": "0",
            "showPercentValues": "0",
            "showLegend": "0",
            "showValues": "0",
            "legendShadow": "0",
            "legendBorderAlpha": "0",
            "decimals": "0",
            "showToolTip": "1",
            "toolTipColor": "#183b7b",
            "toolTipBorderThickness": "0",
            // "toolTipBgColor": "#000000",
            "toolTipBgColor": "#ffffff",
            "toolTipBorderColor": "#000000",
            "toolTipBgAlpha": "80",
            "toolTipBorderRadius": "2",
            "toolTipPadding": "5",
            "plottooltext": "$label:$value",
            formatNumberScale: 0,
            enableSlicing:"1",
            "theme": "fint",
        },
        "data": [
        ]
    }
}

const area2DConfig = {
    type: 'area2d',
    renderAt: 'chart-container',
    width: '100%',
    height: '300',
    dataFormat: 'json',
    dataSource: {
        "chart": {
            "caption": "",
            "subCaption": "",
            "xAxisName": "Day",
            "yAxisName": "Sales (In USD)",
            "numberPrefix": "$",
            "paletteColors": "#0075c2",
            "bgColor": "#ffffff",
            "showBorder": "0",
            "labelStep": "5",
            "showCanvasBorder": "0",
            "plotBorderAlpha": "10",
            "usePlotGradientColor": "0",
            "plotFillAlpha": "100",
            "showXAxisLine": "1",
            "axisLineAlpha": "25",
            "divLineAlpha": "10",
            "showValues": "0",
            "showAlternateHGridColor": "0",
            "captionFontSize": "14",
            "subcaptionFontSize": "14",
            "subcaptionFontBold": "0",
            "toolTipColor": "#183b7b",
            "toolTipBorderThickness": "0",
            "toolTipBgColor": "#ffffff",
            "toolTipBorderColor": "#000000",
            "toolTipBgAlpha": "80",
            "toolTipBorderRadius": "2",
            "toolTipPadding": "5",
            "labelDisplay":'wrap',
            // "slantLabels":'2'
        },
        
        "data": [
        ]
    }
}

const getColors = function(){
    return ['#F68C1F', '#1270b8', '#a6ddf6', '#35ace1', '#4285f4', '#ffd200' ];
}

export { doughNut2DConfig, lineConfig, column2DConfig, pie2DConfig, area2DConfig };
export { getColors };